package cn.xxliang.platapp.controller;

import cn.xxliang.platapp.pojo.dto.ProductExtendInfoDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import cn.xxliang.platapp.common.BaseRespWithData;
import cn.xxliang.platapp.common.BasePage;
import java.util.List;
import cn.xxliang.platapp.pojo.query.ProductExtendInfoQuery;

@RestController
@RequestMapping("/productExtend")
@Api(tags = "产品扩展信息管理")
public class ProductExtendController {

    @PostMapping("/add")
    @ApiOperation("添加产品扩展信息 ✅")
    public BaseRespWithData addProductExtend(@RequestBody @Valid ProductExtendInfoDto dto) {
        return new BaseRespWithData().code(200).msg("添加成功");
    }

    // @GetMapping("/list")
    // @ApiOperation("根据product_extend_info_id查询产品扩展信息列表")
    // public BaseRespWithData<List<ProductExtendInfoDto>> listProductExtend(@RequestBody @Valid ProductExtendInfoQuery query) {
    //     return new BaseRespWithData().code(200).msg("查询成功");   
    // }

    @GetMapping("/listByProductId")
    @ApiOperation("根据platformProductId查询产品扩展信息列表 ✅")
    public BaseRespWithData<List<ProductExtendInfoDto>> listProductExtendByProductId(@RequestParam @NotNull(message = "platformProductId不能为空") Integer platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功");   
    }

    @GetMapping("/delete")
    @ApiOperation("根据产品扩展信息id删除产品扩展信息 ✅")
    public BaseRespWithData deleteProductExtend(@RequestParam @NotNull(message = "产品扩展信息ID不能为空") Integer platformProductId) {
        return new BaseRespWithData().code(200).msg("删除成功");
    }
}